﻿using IdentityDemo.Web.Areas.SysManage.Models;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace IdentityDemo.Web.Data
{
    public class AppZZContext : IdentityDbContext<AppUser>
    {
        public AppZZContext(DbContextOptions<AppZZContext> options) : base(options)
        {

        }

        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);
            // Customize the ASP.NET Identity model and override the defaults if needed.
            // For example, you can rename the ASP.NET Identity table names and more.
            // Add your customizations after calling base.OnModelCreating(builder);


            //更改表名称
            builder.Entity<AppUser>(b =>
            {
                b.ToTable(name: "Sys_User");
            });
        }

        public DbSet<AppUser> Users { get; set; }
        public DbSet<Menu> Menus { get; set; }
    }
}
